package com.itboye.jmsfhz.app.ui.me;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.text.style.ImageSpan;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.itboye.core.alert.ByAlert;
import com.itboye.core.object.BaseActivity;
import com.itboye.core.object.SpPublicParams;
import com.itboye.core.utils.SPUtils;
import com.itboye.jmsfhz.R;

public class ActivityRevisePhone extends BaseActivity implements
		OnClickListener {
	ImageView back;
	TextView txt_title;
	ImageView img_other;
	EditText ed;
	EditText edit_code;
	TextView next, getYzm;
	TextView currentPhonenumber;
	EditText edit_pwd;
	protected String password;

	@Override
	public int initView() {
		// TODO Auto-generated method stub
		return R.layout.activity_revise_phonenum;
	}

	@Override
	public void onMyCreate() {
		IntentFilter intent=new IntentFilter("bindfinish");
		registerReceiver(receiver, intent);
		currentPhonenumber.setText((String) SPUtils.get(this, null,
				SpPublicParams.PHONE_MODEL, ""));
		txt_title.setText("输入初始密码");
		img_other.setVisibility(View.GONE);

	}

	BroadcastReceiver receiver=new BroadcastReceiver(){

		@Override
		public void onReceive(Context context, Intent intent) {
			// TODO Auto-generated method stub
			finish();
		}
		
	};
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v.getId() == R.id.next) {
			password = edit_pwd.getText().toString().trim();
			if (password == null) {
				ByAlert.alert("请输入密码");
			} else {
				Intent intent = new Intent(ActivityRevisePhone.this,
						ActivityNewPhone.class);
				intent.putExtra("pwd", password);
				startActivity(intent);
			}
		}
	}
}
